<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
<sql:query var="rs" dataSource="jdbc/j102"  scope="page">
	<c:choose>
	<c:when test="${empty param.m_userid }">
		select * from boards
	</c:when>
	<c:otherwise>
		select * from boards where m_userid=?
		<sql:param>${param.m_userid }</sql:param>
	</c:otherwise>
	</c:choose>
</sql:query>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>清單</title>
</head>
<body>
<a href="index.jsp">回首頁</a><br>
<form action="">
<input type="text" name="m_userid">
<input type="submit" value="搜尋">
</form>
Total:${rs.rowCount }
<table border="1">
	<c:forEach var="p" items="${rs.rows }">
	
	<TR>
		<TD>${p.m_userid }</TD>
		<TD>${p.m_nickname }</TD>
		<TD>${p.board_object}</TD>
		<TD>${p.board_Date}</TD>
		<TD>${p.board_content}</TD>
		<TD><a href="delete_post.jsp?id">刪除</a></TD>
	</TR>
	</c:forEach>
</table>

</body>
</html>